<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        firstName:<input v-model="firstName"/><br>
        lastName:<input v-model="lastName"/><br>
        <h1>{{fullName}}</h1>
    </div>
    <script src="">
    const aa= new Vue({
            el:"#app",
            data:{
                firstName:"张",
                lastName:"三",
                fullName:""
            },
            // watch:{
            //     //监测姓
            //     firstName(newValue,oldVue){
            //         this.fullName=newValue+ '-'+this.lastName
            //     }
            //     //监测名
            // }
          
        })
    </script>
</body>
</html>